﻿using QFramework;
using UnityEngine;

namespace GameJamLight
{
    public interface IInteractiveItem
    {
        void Trigger();
    }
    public interface IGameModel : IModel
    {
        BindableProperty<int> CurLevelID { get; }
        BindableProperty<int> Mental { get; }
    }
    public class GameModel : AbstractModel, IGameModel
    {
        public BindableProperty<int> CurLevelID { get; } = new BindableProperty<int>();
        public BindableProperty<int> Mental { get; } = new BindableProperty<int>(100);

        protected override void OnInit()
        {
            string key = nameof(CurLevelID);
            CurLevelID.Value = PlayerPrefs.GetInt(key, 0);
            CurLevelID.Register(id => PlayerPrefs.SetInt(key, id));
        }
    }
}